﻿Public Class ChildTableSchema

    Private _parentTable As TableSchema

    Public ReadOnly Property ParentTable As TableSchema
        Get
            Return _parentTable
        End Get
    End Property

    Private _attribute As ChildTableAttribute

    Public ReadOnly Property TableType As Type
        Get
            Return _attribute.EntityType
        End Get
    End Property

    Public ReadOnly Property TableName As String
        Get
            Return _attribute.EntityType.Name
        End Get
    End Property

    Public ReadOnly Property Description As String
        Get
            Return _attribute.Description
        End Get
    End Property

    Public ReadOnly Property CanViewRecords As Boolean
        Get
            Return _attribute.CanViewRecords
        End Get
    End Property

    Public ReadOnly Property CanAddRecords As Boolean
        Get
            Return _attribute.CanAddRecords
        End Get
    End Property

    Public ReadOnly Property CanEditRecords As Boolean
        Get
            Return _attribute.CanEditRecords
        End Get
    End Property

    Public ReadOnly Property CanDeleteRecords As Boolean
        Get
            Return _attribute.CanDeleteRecords
        End Get
    End Property

    Friend Sub New(ByVal parentTable As TableSchema, ByVal attribute As ChildTableAttribute)
        Me._parentTable = parentTable
        Me._attribute = attribute
    End Sub

End Class
